//
//  FriendDetailViewController.m
//  cityCar
//
//  Created by yao on 14-11-10.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "FriendDetailViewController.h"

@interface FriendDetailViewController ()

@end

@implementation FriendDetailViewController

- (void)dealloc
{
    [_userUrl release];
    [super dealloc];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setupView];
}

- (void)setupView
{
    // 屏幕宽和高
    CGFloat x = self.view.frame.size.width;
    CGFloat y = self.view.frame.size.height;
    
    UIWebView *myWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, x, y)];
    myWeb.backgroundColor = [WebColor whiteSmoke];
    myWeb.tag = 999;
    NSURL *url = [NSURL URLWithString:self.userUrl];
    NSURLRequest *request=[[NSURLRequest alloc] initWithURL:url];
    myWeb.scrollView.bounces = NO;
    [myWeb loadRequest:request];
    [self.view addSubview:myWeb];
    [myWeb release];
    [request release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(10, 25, 30, 30);
    [button setImage:[UIImage imageNamed:@"iconfont-fanhui.png"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
    button.tintColor = [WebColor black];
    [self.view addSubview:button];
    
}

// 返回
- (void)buttonClicked:(UIButton *)button
{
    [self.navigationController setNavigationBarHidden:NO];
    self.tabBarController.tabBar.hidden = NO;
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
